define(function(require, exports, module) {
    "use strict";
    var $ = require("$"),
        app = require("dist/application/app"),
        config = app.config,
        method = app.method;
   var $js_generalize_set=$(".js_generalize_set");
   $js_generalize_set.length&&(function(){
        var type=$(".js_generalize_set:checked").data("type"),
        $js_generalize_open=$(".js_generalize_open");
        if(type=="open"){
            $js_generalize_open.removeClass('hide');
        }
        $js_generalize_set.click(function(){
            var $this=$(this),flag=$this.prop("checked"),types=$this.data("type");
            if(flag&&types=="open"){
                $js_generalize_open.removeClass('hide');
            }else{
                $js_generalize_open.addClass('hide');
            }
        });
   })();

   var $js_goods_ctype=$(".js_goods_ctype");
   $js_goods_ctype.length&&(function(){
    var types=$(".js_goods_ctype:checked").data("type"),$js_party_goods=$(".js_party_goods");
    if(types=="all"){
        $js_party_goods.addClass("hide");
    }
    $("#goods_select_type").val($(".js_goods_ctype:checked").val());
    $js_goods_ctype.click(function(){
        var $this=$(this),type=$this.data("type");
        if(type=="all"){
            $js_party_goods.addClass("hide");
        }else{
            $js_party_goods.removeClass("hide");
        }
        $("#goods_select_type").val($this.val());
    });
   })();

   
   
   /* $(document).on("keyup",".js_commissions_set",function(){
        var $this=$(this),$tr=$(this).closest("tr"),price=$this.data("price"),
        path=$this.data("path"),$show=$(".js_result_show",$tr),val=(parseFloat($this.val())||0)/100;
        if(!$this.hasClass("error")){
            if (price) {
                if (price.length > 1) {
                    $show.html((price[0] * val).toFixed(2) + "~" + (price[1] * val).toFixed(2));
                } else {
                    $show.html((price[0] * val).toFixed(2));
                }
            }
            method.post(path, function(data) {
                if (config.issucceed(data)) {

                } else {
                    config.msg.error(data.message);
                }
            }, config.lang.exception, false, {
                "commissions": parseFloat($this.val())||0
            });
        }
        
    });*/

    $(function() {
        if(modal){
            $("#js_basic").modal("show");
        }
    });
    $("#fw_basic").length && $("#fw_basic").click(function(){
        location.href= url;
    })
    $('#js_basic').on('hidden.bs.modal', function (e) {
        location.href= url;
    })
})
